import request from '@/utils/request'

export function addMenuApi(data) {
  return request({
    url: '/menu',
    method: 'post',
    data
  })
}

export function deleteMenuApi(params) {
  return request({
    url: '/menu',
    method: 'delete',
    params
  })
}

export function updateMenuApi(data) {
  return request({
    url: '/menu',
    method: 'put',
    data
  })
}

export function getMenuApi(params) {
  return request({
    url: '/menu',
    method: 'get',
    params
  })
}

export function getParentMenuApi(params) {
  return request({
    url: '/menu/parent',
    method: 'get',
    params
  })
}

export function getMenuPermissionApi(params) {
  return request({
    url: '/menu/permission',
    method: 'get',
    params
  })
}

export function getMenuPermission2Api(params) {
  return request({
    url: '/menu/permission2',
    method: 'get',
    params
  })
}